USE [OHNEW]
GO

IF  EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_S_TableField_S_Table]') AND parent_object_id = OBJECT_ID(N'[dbo].[S_TableField]'))
ALTER TABLE [dbo].[S_TableField] DROP CONSTRAINT [FK_S_TableField_S_Table]
GO

USE [OHNEW]
GO

ALTER TABLE [dbo].[S_TableField]  WITH NOCHECK ADD  CONSTRAINT [FK_S_TableField_S_Table] FOREIGN KEY([TableName])
REFERENCES [dbo].[S_Table] ([TableName])
GO

ALTER TABLE [dbo].[S_TableField] CHECK CONSTRAINT [FK_S_TableField_S_Table]
GO


